//
//  DepoistTypeListSubItemCell.swift
//  d11
//
//  Created by peale on 2018/10/20.
//  Copyright © 2018年 Tech_001. All rights reserved.
//

import UIKit

class DepoistTypeListSubItemCell: UITableViewCell {
    var bgImgView : UIImageView?
    var titleLabel : UILabel?
    var arrowImgView : UIImageView?
    var lineView : UIView?
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.setUpUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
    }
    
    func setUpUI() -> Void {
        self.backgroundColor  = UIColor.white
        self.selectionStyle = UITableViewCell.SelectionStyle.none
        
        self.bgImgView = UIImageView.init()
        self.bgImgView?.image = imageNamed("icon_my_cell_item")?.resizableImage(withCapInsets: UIEdgeInsets(top: 5, left: 30, bottom: 5, right: 30),
                                                                                 resizingMode: .stretch) //左右15像素的部分不变，中间部分来拉伸
        self.contentView.addSubview(bgImgView!);
        self.bgImgView?.snp.makeConstraints{(make) in
            make.width.equalToSuperview().offset(-20)
            make.height.equalTo(60)
            make.centerX.equalTo(self.contentView)
        };
        

      
        
        self.arrowImgView = UIImageView.init()
        self.arrowImgView?.image = imageNamed("icon_depoist_cell_arrow")
        self.bgImgView?.addSubview(self.arrowImgView!)
        
        self.arrowImgView?.snp.makeConstraints{(make) in
            make.right.equalToSuperview().offset(-12)
            make.width.equalTo(9)
            make.centerY.equalTo(self.bgImgView!)
            make.height.equalTo(15)
        }
        
        self.titleLabel = UILabel.init()
        self.titleLabel?.text = "网银"
        self.titleLabel?.textColor = HexRGBAlpha(0x333333, 1)
        self.titleLabel?.font = UIFont.systemFont(ofSize: 15)
        self.titleLabel?.textAlignment = NSTextAlignment.left
        self.bgImgView?.addSubview(self.titleLabel!)
        
        self.titleLabel?.snp.makeConstraints{(make) in
            make.left.equalTo(107)
            make.right.equalToSuperview().offset(-30)
            make.height.equalTo(51)
            make.centerY.equalToSuperview()
        }
        
        
        self.lineView = UIView.init()
        self.lineView?.backgroundColor = HexRGBAlpha(0xF3F3F3, 1)
        self.lineView?.isHidden = true
        self.bgImgView?.addSubview(self.lineView!)
        
        self.lineView?.snp.makeConstraints{(make) in
            make.centerX.equalToSuperview()
            make.width.equalToSuperview().offset(-10)
            make.height.equalTo(0.7)
            make.bottom.equalToSuperview()
        }
    }
    
 
}
